package store.lunangangster.bpmn.converter;

import javax.xml.stream.XMLStreamReader;
import store.lunangangster.bpmn.model.BpmnModel;
import store.lunangangster.bpmn.model.ExclusiveGateway;
import store.lunangangster.bpmn.util.BpmnXmlUtil;

public class ExclusiveGatewayConverter extends GatewayConverter {

  @Override
  protected ExclusiveGateway convertToElement(XMLStreamReader xsr, BpmnModel model) throws Exception {
    ExclusiveGateway exclusiveGateway = new ExclusiveGateway();
    BpmnXmlUtil.addXmlLocation(xsr, exclusiveGateway);
    parseGatewayAttribute(xsr, exclusiveGateway);
    parseChildElement(xsr, exclusiveGateway, getTargetName(), model);
    return exclusiveGateway;
  }

  @Override
  public String getTargetName() {
    return ELEMENT_GATEWAY_EXCLUSIVE;
  }
}
